define(function(require, exports, module) {
    "require:nomunge,exports:nomunge,module:nomunge";

    var view = require('mokit/view');
    var grid = require("mokit/grid");
    var $ = require('mokit/jquery');
    var move = require('mokit/move');
    var $utils = require('mokit/utils');
    var commonUtils = require('../common/utils');
    var app = require('mokit/app');

    var menuDur = 180;
    var panelDur = 260;

    /**
     * 主页视图
     */
    return view.create({
        template: module.resovleUri('../templates/home.html'),

        /**
         * 元素
         */
        el: {},

        utils: commonUtils,

        /**
         * 在呈现完成时
         */
        onRender: function(context) {
            var self = this;
            grid.use(self.ui);
        },

        /**
         * 在子视图呈现完成
         */
        onChildRender: function(context) {
            var self = this;
            var path = this.model.user.syproUri;
            var arr = this.model.data.carlist.map(function(item){
            	return { image: path + item.imageUrl };
            });
            self.banner.setItems(context, arr);
            /*
            [{
                image: 'http://image.tianjimedia.com/uploadImages/2014/103/04/RC334576H005_680x500.jpg'
            },{
                image: 'http://image.tianjimedia.com/uploadImages/2014/103/05/X028LF51BH42_680x500.jpg'
            }]);*/
        },

        startTalk: function(context) {
            var self = this;

            imkit.startTalk("1", '会话', function(rs) {
                //ok
            }, function(err) {
                alert('启动会话失败' + err);
            });

        }

    });

});